home *** CD-ROM | disk | FTP | other *** search
/ Champak 128 / Vol 128 (Damaged).iso / games / gandy_sq.swf / scripts / frame_6 / DoAction.as
Encoding:
Text File  |  2011-03-26  |  2.1 KB  |  76 lines

  1. function GandyHit()
  2. {
  3.    _root.gandy._x = _root.gandyxstart;
  4.    _root.gandy._y = _root.gandyystart;
  5.    _root.gandy.leftspeed = 0;
  6.    _root.gandy.rightspeed = 0;
  7.    _root.gandy.upspeed = 0;
  8.    _root.score -= 25;
  9.    _root.lives--;
  10.    s = new Sound();
  11.    s.attachSound("ouchsound");
  12.    s.setVolume(100);
  13.    s.start();
  14.    if(_root.lives < 1)
  15.    {
  16.       _root.level = 16;
  17.       _root.platforms.gotoAndStop(16);
  18.       _root.obstacles.gotoAndStop(16);
  19.       _root.background.gotoAndStop(16);
  20.       _root.foreground.gotoAndStop(16);
  21.       _root.gandy.leftspeed = 0;
  22.       _root.gandy.rightspeed = 0;
  23.       _root.gandy.upspeed = 0;
  24.       _root.steam._x = -200;
  25.       _root.ospikes._x = -100;
  26.       _root.spikes._x = -100;
  27.       _root.moriaspikes._x = -100;
  28.       _root.ospikes2.removeMovieClip();
  29.       _root.ospikes3.removeMovieClip();
  30.       _root.moriaspikes2.removeMovieClip();
  31.       _root.spikes2.removeMovieClip();
  32.       _root.spikes3.removeMovieClip();
  33.       _root.spider2.removeMovieClip();
  34.       _root.bigflame._x = -200;
  35.       _root.ickywater._x = -400;
  36.       _root.orc._x = -200;
  37.       _root.orc2._x = -200;
  38.       _root.spider1._x = -200;
  39.       _root.spiderdown1._x = -200;
  40.       _root.troll._x = -200;
  41.       _root.orcarcher._x = -200;
  42.       _root.arrowpath._x = -400;
  43.       _root.saruman._x = -550;
  44.       _root.bliksem._x = -550;
  45.       _root.mypipe._x = -610;
  46.       _root.exitsign._x = -610;
  47.       _root.goldxpos = new Array(-200,-200,-200,-200,-200,-200);
  48.       _root.goldypos = new Array(-200,-200,-200,-200,-200,-200);
  49.       _root.BuildLevel();
  50.    }
  51. }
  52. function BuildLevel()
  53. {
  54.    aa = 0;
  55.    while(aa < 6)
  56.    {
  57.       _root["coin" + aa]._x = goldxpos[aa];
  58.       _root["coin" + aa]._y = goldypos[aa];
  59.       aa++;
  60.    }
  61. }
  62. game = "gandy";
  63. level = 1;
  64. lives = 20;
  65. goldxpos = new Array(15,180,230,390,610,520);
  66. goldypos = new Array(90,90,300,400,30,400);
  67. aa = 0;
  68. while(aa < 6)
  69. {
  70.    _root.coin0.duplicateMovieClip("coin" + aa,aa);
  71.    _root["coin" + aa]._x = goldxpos[aa];
  72.    _root["coin" + aa]._y = goldypos[aa];
  73.    aa++;
  74. }
  75. stop();
  76.